﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmCRUDProveedor.aspx.cs" Inherits="SISLOG.Web.frmCRUDProveedor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend><asp:Label id="LabelTitulo" runat="server"></asp:Label></legend>
<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" 
        DefaultMode="Edit" oniteminserted="FormView1_ItemInserted" 
        onitemupdated="FormView1_ItemUpdated">        
        <EditItemTemplate>
            <table class="style1">
                <%--<tr>
                    <td>
                        Id Proveedor:</td>
                    <td>
                        <asp:TextBox ID="idProveedorTextBox" runat="server" 
                            Text='<%# Bind("idProveedor") %>' />
                    </td>
                </tr>--%>
                <tr>
                    <td>
                        Nombre Empresa:</td>
                    <td>
                        <asp:TextBox ID="nombreEmpresaTextBox" runat="server" 
                            Text='<%# Bind("nombreEmpresa") %>' Enabled="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        RUC:</td>
                    <td>
                        <asp:TextBox ID="rucTextBox" runat="server" Text='<%# Bind("ruc") %>' 
                            Enabled="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Dirección:</td>
                    <td>
                        <asp:TextBox ID="direccionTextBox" runat="server" 
                            Text='<%# Bind("direccion") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Teléfono:</td>
                    <td>
                        <asp:TextBox ID="telefonoTextBox" runat="server" 
                            Text='<%# Bind("telefono") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        E- mail:</td>
                    <td>
                        <asp:TextBox ID="emailTextBox" runat="server" Text='<%# Bind("email") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Representante:</td>
                    <td>
                        <asp:TextBox ID="representanteTextBox" runat="server" 
                            Text='<%# Bind("representante") %>' />
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Actualizar" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:LinkButton ID="UpdateCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancelar" 
                            PostBackUrl="~/frmProveedor.aspx" />
                    </td>
                </tr>
            </table>            
        </EditItemTemplate>
        <InsertItemTemplate>
            <table class="style1">
                <tr>
                    <td>
                        Id Proveedor:</td>
                    <td>
                        <asp:TextBox ID="idProveedorTextBox" runat="server" 
                            Text='0' Enabled="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Nombre Empresa:</td>
                    <td>
                        <asp:TextBox ID="nombreEmpresaTextBox" runat="server" 
                            Text='<%# Bind("nombreEmpresa") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        RUC:</td>
                    <td>
                        <asp:TextBox ID="rucTextBox" runat="server" Text='<%# Bind("ruc") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Durección:</td>
                    <td>
                        <asp:TextBox ID="direccionTextBox" runat="server" 
                            Text='<%# Bind("direccion") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Teléfono:</td>
                    <td>
                        <asp:TextBox ID="telefonoTextBox" runat="server" 
                            Text='<%# Bind("telefono") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        E- mail:</td>
                    <td>
                        <asp:TextBox ID="emailTextBox" runat="server" Text='<%# Bind("email") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Representante:</td>
                    <td>
                        <asp:TextBox ID="representanteTextBox" runat="server" 
                            Text='<%# Bind("representante") %>' />
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                        CommandName="Insert" Text="Insertar" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:LinkButton ID="InsertCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancelar" 
                            PostBackUrl="~/frmProveedor.aspx" />
                    </td>
                </tr>
            </table>           
        </InsertItemTemplate>
        <ItemTemplate>
            idProveedor:
            <asp:Label ID="idProveedorLabel" runat="server" 
                Text='<%# Bind("idProveedor") %>' />
            <br />
            nombreEmpresa:
            <asp:Label ID="nombreEmpresaLabel" runat="server" 
                Text='<%# Bind("nombreEmpresa") %>' />
            <br />
            ruc:
            <asp:Label ID="rucLabel" runat="server" Text='<%# Bind("ruc") %>' />
            <br />
            direccion:
            <asp:Label ID="direccionLabel" runat="server" Text='<%# Bind("direccion") %>' />
            <br />
            telefono:
            <asp:Label ID="telefonoLabel" runat="server" Text='<%# Bind("telefono") %>' />
            <br />
            email:
            <asp:Label ID="emailLabel" runat="server" Text='<%# Bind("email") %>' />
            <br />
            representante:
            <asp:Label ID="representanteLabel" runat="server" 
                Text='<%# Bind("representante") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Editar" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="Nuevo" />
        </ItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        DataObjectTypeName="SISLOG.BusinessEntities.Proveedor" 
        InsertMethod="RegistrarProveedor" 
        onobjectcreating="ObjectDataSource1_ObjectCreating" 
        SelectMethod="GetAllFromProveedorByIdProveedor" 
        TypeName="SISLOG.BusinessLogic.ProveedorBL" UpdateMethod="RegistrarProveedor">
        <SelectParameters>
            <asp:QueryStringParameter Name="idProveedor" QueryStringField="id" 
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </fieldset>
</asp:Content>
